import request from "../utils/interceptors";

export const login = (data) => {
  return request({
    method: "POST",
    url: "/api//login",
    data,
  });
};

// 首页顶部tab
export const TagInfo = () => {
  return request({
    method: "GET",
    url: "/api/category",
  });
};

// 首页主体商品
export const list_box = (params) => {
  console.log(params);
  return request({
    method: "GET",
    url: `/api/groom/list/${params}?page=1&limit=10`,
  });
};

// 热门推荐
export const host = (params) => {
  return request({
    method: "GET",
    url: "/api/product/hot?page=1&limit=10",
  });
};

// 优惠券
export const coupon = () => {
  return request({
    method: "GET",
    url: "/api/coupons?page=1&limit=40",
  });
};

// 搜索页 排序
export const products = (params) => {
  console.log(params);
  return request({
    method: "GET",
    url: `/api/products?sid=0&keyword=&priceOrder=&salesOrder=&news=0&page=1&limit=20&cid=${params}`,
  });
};

// 热门推荐
export const hotApi = () => {
  return request({
    method: "GET",
    url: "/api/product/hot?page=1&limit=10",
  });
};

export const detailsApi = (params) => {
  console.log(params);
  return request({
    method: "GET",
    url: `/api/product/detail/${params}`,
  });
};
